import React, { memo } from 'react'
import _ from 'lodash'
import { Radio } from 'antd'

const CommonRadio = memo(function CommonRadio({
  options = [],
  onChange = null,
  value,
}) {
  return (
    <>
      <Radio.Group onChange={onChange} value={value}>
        {_.map(options, (item) => {
          return (
            <Radio
              key={item.label}
              value={item.value}
              style={{
                lineHeight: '32px',
              }}
            >
              {item.label}
            </Radio>
          )
        })}
      </Radio.Group>
    </>
  )
})

export default CommonRadio
